package com.zmn.uac.dubbo.interfaces.oauth.login;

import com.zmn.common.dto2.ResponseDTO;
import com.zmn.uac.common.dio.oauth.login.TempCodeDIO;
import com.zmn.uac.common.dio.oauth.login.UserAuthLoginDIO;
import com.zmn.uac.common.dro.oauth.login.UserAuthLoginDRO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import javax.validation.constraints.NotNull;

/**
 * 类描述：登录基础服务方法
 *
 * @author xujie
 * @since 2021/05/18 17:34
 */
@Api(tags = {"登录基础服务方法"})
public interface LoginBaseRemoteService {

    /**
     * 公众号授权用户登陆
     *
     * @param dio 用户授权登陆参数
     * @return ResponseDTO<UserAuthLoginDRO>
     * @author xujie
     * @since 2021/05/18
     */
    @ApiOperation(value = "公众号授权用户登陆", notes = "返回用户授权登陆响应对象")
    ResponseDTO<UserAuthLoginDRO> officialAccountAuthLogin(@ApiParam(value = "UserAuthLoginDIO", name = "公众号授权用户登陆参数", required = true)
                                                           @NotNull(message = "公众号授权用户登陆参数UserAuthLoginDIO不能为空") UserAuthLoginDIO dio);


    /**
     * 小程序授权登陆
     *
     * @param dio 用户授权登陆参数
     * @return ResponseDTO<UserAuthLoginDRO>
     * @author xujie
     * @since 2021/05/18
     */
    @ApiOperation(value = "小程序授权登陆", notes = "返回用户授权登陆响应对象")
    ResponseDTO<UserAuthLoginDRO> login(@ApiParam(value = "UserAuthLoginDIO", name = "小程序授权用户登陆参数", required = true)
                                        @NotNull(message = "小程序授权用户登陆参数UserAuthLoginDIO不能为空") UserAuthLoginDIO dio);

    /**
     * 根据临时授权码获取用户openid
     *
     * @return
     */
    @ApiOperation(value = "根据临时授权码获取用户openid")
    ResponseDTO<String> getOpenIdByTempCode(@ApiParam(value = "TempCodeDIO", name = "授权code", required = true)
                                            @NotNull(message = "授权code不能为空") TempCodeDIO tempCodeDIO);
}
